#include <iostream>
#include <vector>
using std::vector;
using std::cout;
using std::endl;

void test(){

    vector<int> number({1,2,3,4,5,6,7,8});
    auto it1 = number.begin();
    auto it2 = number.end();
    //vector<int>::iterator it2 = number.end();
    while(it1 != it2){
        cout << *it1 <<endl;
        ++it1;
    }
}
void test2(){

    vector<int> number({1,2,3,4,5});
    for(size_t i = 0;i<number.size();i++){
        cout << number[i] << endl;
    }
}

void test3(){

    vector<int>numbers;
    numbers.push_back(1);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(2);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(3);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(4);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(5);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(6);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(7);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(8);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.pop_back();
    numbers.pop_back();
    numbers.pop_back();
    numbers.shrink_to_fit();
    numbers.clear();
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    for(auto & num : numbers){
        cout << num ;
    }
    cout << endl;
}

void test4(){

    vector<int>numbers;
    numbers.reserve(10);
    numbers.push_back(1);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(2);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(3);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(4);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(5);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(6);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(7);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    numbers.push_back(8);
    cout << numbers.size() << endl;
    cout << numbers.capacity() << endl;
    cout << "------------" << endl;
    for(auto & num : numbers){
        cout << num ;
    }
    cout << endl;
    cout << "------------" << endl;
    auto it1 = numbers.begin();
    auto it2 = numbers.end();
    //vector<int>::iterator it2 = number.end();
    while(it1 != it2){
        cout << *it1 ;
        ++it1;
    }
    cout << endl;
    cout << "------------" << endl;
    for(size_t i = 0;i < numbers.size();i++){
        cout << numbers[i] ;
    }
    cout << endl;
}

int main()
{
    test4();
    return 0;
}

